# views2.py
from django.views.generic import View
class HelloView(View):
	def get(self, request, name='World'):
		return HttpResponse('Hello {}!'.format(name))


class GreetView(View):
	greeting = 'Hello {}!'
	default_name = 'World'

	def get(self, request, **kwargs):
		name = kwargs.pop('name', self.default_name)
		return HttpResponse(self.greeting.format(default_name))


class SuperVillain(GreetView):
	greeting = 'We are the future, {}. Not them.'
	default_name = 'my friend'


# in urls.py conf
# ...
url(r'^hello-su/(?P<name>\w+)/$', views.SuperVillain.as_view())
url(r'^hello-su/$', views.SuperVillain.as_view()),

# vanilla Views
from django.views.generic import CreateView

class AccountCreateView(CreateView):
	model = Account

	def get_success_url(self):
		return self.object.acount_activated_url()

	def get_form_class(self):
		if self.request.user.is_staff:
			return AdminAccountForm
		return AccountForm

	def get_form_kwargs(self):
		kwargs = super(AccountCreateView, self).get_form_kwargs()
		